{% extends "../../base.html"%} {% block header_title %}后台管理首页{% end %} {% block static_css %}
<link rel="stylesheet" href="{{ static_url('data/css/list.css') }}" />{% end%} {% block body %}
<div class="row">
    <div class="col-xs-1 col-sm-1 col-md-1 sidebar">
        <div class="user">
            <img src="{{static_url('images/ico-user-header.svg')}}">
            <h5>{{current_user['username']}}</h5>
            <a href="/auth/signout"><span class="glyphicon glyphicon-cog"title="用户中心"></span></a>&nbsp;
            <a href="/auth/signout">
                <span class="glyphicon glyphicon-off" aria-hidden="true"></span>
            </a>
        </div>
        <ul class="nav nav-sidebar">
            <li title="首页">
                <a href="/admin">
                    <i class="fa fa-home"></i>
                    <span class="hidden-sm hidden-xs text">首页</span>
                </a>
            </li>
            <li title="数据集" class="active">
                <a href="/admin/data">
                    <i class="fa fa-archive"></i>
                    <span class="hidden-sm hidden-xs text">数据集</span>
                </a>
            </li>
            <li title="申请单">
                <a href="/admin/apply">
                    <i class="fa fa-clipboard"></i>
                    <span class="hidden-sm hidden-xs text">申请单</span>
                </a>
            </li>
            <li title="应用表">
                <a href="/admin/app">
                    <i class="fa fa-cube"></i>
                    <span class="hidden-sm hidden-xs text">应用表</span>
                </a>
            </li>
        </ul>
    </div>
    <div class="col-xs-11 col-xs-offset-1 col-sm-11 col-sm-offset-1 col-md-11 col-md-offset-1 main">
        <div class="page-header">
            <h1>数据集</h1><small>这里列举的是最新的数据<br>可以从这选取数据进行分析<br></small>
            <a href="/data/form" class="btn btn-primary">
                <i class="fa fa-paperclip"></i> 新增数据
            </a>
        </div>
        <section>
            <div class="row">
                <div class="col-md-9">
                    <div class="box">
                        <div class="box-title">
                            <h5>待发布的数据</h5>
                        </div>
                        <div class="box-body">
                            <table class="table">
                                <thead>
                                    <tr>
                                        <th class="header sortable">
                                            状态
                                        </th>
                                        <th class="header sortable">
                                            数据集名
                                        </th>
                                        <th class="header sortable">
                                            来源
                                        </th>
                                        <th class="header sortable">
                                            类型
                                        </th>
                                        <th class="header sortable">
                                            更新时间
                                        </th>
                                        <th class="header sortable">

                                        </th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {% for each in data_standby %}
                                    <tr>
                                        {% set status = each['status']%}
                                        <td>{%if status==0%}<span class="label label-warning">待完成</span>{%elif status ==10%}<span class="label label-success">可发布</span>{%end%}
                                        </td>
                                        <td>
                                            {{each['title']}}
                                        </td>
                                        <td>
                                            {{each['from']}}
                                        </td>
                                        <td>{{each['dtype']}}</td>
                                        <td>{{date_format(each['updatetime'])}}</td>
                                        <td>
                                            <a href="/admin/data/{{each['_id']}}" class="btn btn-default btn-xs">查看</a>
                                        </td>
                                    </tr>
                                    {%end%}
                                </tbody>
                            </table>
                            <div class="table-tools">
                                {% raw pagenav(now = data_standby_page, count = data_standby_count, each = data_standby_size, url = '/admin/data?p=%d') %}
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-md-3">
                    <div class="box">
                        <div class="box-title">
                            <h5>已发布的数据</h5>
                            <div class="box-tools">
                                <a href="/admin/data">
                                    <i class="fa fa-navicon"></i>
                                </a>
                            </div>
                        </div>
                        <div class="box-body">
                            <table class="table">
                                <tbody>
                                    {% for each in data_publish %}
                                    <tr>
                                        <td>
                                            {{each['title']}}
                                        </td>
                                        <td>{{each['dtype']}}</td>
                                        <td>
                                            <a href="/admin/data/{{each['_id']}}" class="btn btn-default btn-xs">查看</a>
                                        </td>
                                    </tr>
                                    {%end%}
                                </tbody>
                            </table>
                        </div>
                        <div class="box-title">
                            <h5>下架的数据</h5>
                            <div class="box-tools">
                                <a href="/admin/data">
                                    <i class="fa fa-navicon"></i>
                                </a>
                            </div>
                        </div>
                        <div class="box-body">
                            <table class="table">
                                <tbody>
                                    {% for each in data_drop %}
                                    <tr>
                                        <td>
                                            {{each['title']}}
                                        </td>
                                        <td>{{each['dtype']}}</td>
                                        <td>
                                            <a href="/admin/data/{{each['_id']}}" class="btn btn-default btn-xs">查看</a>
                                        </td>
                                    </tr>
                                    {%end%}
                                </tbody>
                            </table>
                        </div>

                    </div>
                </div>
            </div>
        </section>
    </div>
</div>
{% end %}
